package org.jeecg.modules.hc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import org.jeecg.modules.hc.entity.HcCompanyMerchantSetting;
import org.jeecg.modules.hc.mapper.HcCompanyMerchantSettingMapper;
import org.jeecg.modules.hc.service.IHcCompanyMerchantSettingService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 企业商户价格设置
 * @Author: jeecg-boot
 * @Date:   2023-07-15
 * @Version: V1.0
 */
@Service
@AllArgsConstructor
public class HcCompanyMerchantSettingServiceImpl extends ServiceImpl<HcCompanyMerchantSettingMapper, HcCompanyMerchantSetting> implements IHcCompanyMerchantSettingService {

    private HcCompanyMerchantSettingMapper hcCompanyMerchantSettingMapper;

    @Override
    public HcCompanyMerchantSetting queryByMerchantId(String companyId, String merchantId) {
        LambdaQueryWrapper<HcCompanyMerchantSetting> companyMerchantSettingLambdaQueryWrapper = new LambdaQueryWrapper<>();
        companyMerchantSettingLambdaQueryWrapper.eq(HcCompanyMerchantSetting::getCompanyId,companyId)
                .eq(HcCompanyMerchantSetting::getMerchantId,merchantId);
        return hcCompanyMerchantSettingMapper.selectOne(companyMerchantSettingLambdaQueryWrapper);
    }
}
